package com.forum.service.impl;

import com.forum.dto.NoticeDTO;
import com.forum.entity.Notifications;
import com.forum.mapper.NoticeMapper;
import com.forum.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticeServiceImpl implements NoticeService {
    @Autowired
    private NoticeMapper noticesMapper;


    @Override
    public Notifications query() {
        return noticesMapper.query();
    }

    @Override
    public void publish(NoticeDTO noticeDTO) {
        noticesMapper.publish(noticeDTO);
    }

    @Override
    public void deleteById(List<Long> ids) {
        // 批量删除
        noticesMapper.deleteById(ids);
    }

    @Override
    public void updateById(NoticeDTO noticeDTO) {
        noticesMapper.updateById(noticeDTO);
    }
}
